import request from '@/utils/request'

/**
 * 搜索建议
 * @param {string} q 搜索关键词
 * @returns promise
 */

export const getSuggestionsAPI = (q) => {
  return request({
    url: '/v1_0/suggestion',
    method: 'GET',
    params: {
      q
    }
  })
}
/**
 *搜索结果
 * @param {string} q  关键词
 * @param {number} per_page 每一页的数量
 * @param {number} page 页数
 * @returns
 */
export const getResultsAPI = (q, page, per_page) => {
  return request({
    url: '/v1_0/search',
    method: 'GET',
    params: { q, page, per_page }
  })
}
